package com.bmps.springcloud.insuredmicroservice.repository.trial.master;


import com.bmps.springcloud.insuredmicroservice.model.trail.TrialPersonModel;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author lyw
 * @date 2019/6/18 16:36
 **/
@Repository
public interface TrailRepository {

    /**
     * 根据险种获取责任信息
     *
     * @param riskCode 险种
     * @return TrialPersonModel
     * @throws Exception 异常
     */
    TrialPersonModel getResponsibilityInformation(@Param(value = "riskCode") String riskCode) throws Exception;

    /**
     * 获取险种计算公式
     *
     * @param riskCode 险种
     * @return Map<String,String>
     * @throws Exception 异常
     */
    Map<String,String> getRiskFormula(@Param(value = "riskCode") String riskCode) throws  Exception;

    /**
     * 获取险种费率
     *
     * @param riskCode 险种
     * @param rateKey 费率key
     * @return Double
     * @throws Exception 异常
     */
    Double getRiskRate(@Param(value = "riskCode") String riskCode, @Param(value = "rateKey") String rateKey) throws  Exception;

    /**
     * 获取要素映射
     *
     * @param riskCode 险种
     * @param type 类型
     * @return List<Map<String,String>>
     * @throws Exception 异常
     */
    List<Map<String,String>> getElementMapping(@Param(value = "riskCode") String riskCode, @Param(value = "type") String type) throws  Exception;

    /**
     * 获取要素的顺序
     *
     * @param riskCode 险种
     * @param type 类型
     * @return  List<Map<String,String>>
     * @throws Exception 异常
     */
    List<Map<String,String>> queryElementOrder(@Param(value = "riskCode") String riskCode, @Param(value = "type") String type) throws  Exception;
}
